package com.rd.student.wulian.wanggaobo.day0808;

import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;

public class Exam01 {
    public static void main(String[] args) {
        try {
            FileWriter writer = new FileWriter("D:\\JavaCode\\Code\\corejava\\src\\com\\zrrd\\day0808\\Student.txt");
            Scanner scanner = new Scanner(System.in);

            for (int i = 1; i <= 3; i++) {
                System.out.println("第" + i + "个学生的姓名，语文成绩和数学成绩：");
                String name = scanner.next();
                int chineseScore = scanner.nextInt();
                int mathScore = scanner.nextInt();
                int Score = chineseScore + mathScore;

                writer.write("学生姓名：" + name +"语文成绩："+mathScore+"数学成绩："+mathScore+ " 总分：" + Score+"\n");
            }

            writer.close();
            scanner.close();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
